#41-字符串格式化
# print('%s is %s years old' % ('bob', 20))
# print('%s is %d years old' % ('bob', 20))       #d是整数
# print('%s is %d years old' % ('bob', 20.5))     #只取整体。
# print('%s is %f years old' % ('bob', 23.5))     #%f是浮点型，默认六位小数
# print('%s is %5.2f years old' % ('bob', 23.5))  #5.2f是宽度为五，2为小数
# print('%s is %4.3f years old' % ('bob', 12345.5))
# print('97 is %c' % 97)                             #97的是序号a
# print("11 is %#o" % 11)                          ##o表示8进制
# print('%10s%5s' % ('name','age'))                #10个宽度，5右对齐
# print('%10s%5s' %  ('bob','20'))
# print('%10s%5s' %  ('alice', 20))
# print("%-10s%-5s" % ('tom',23))                  #- 负号
# print('%10d ' % 123)
# print('%010d' % 123)                               #十位整数，右对齐，之前以0补齐
# "{} is {} years old".format('bob', 25)
# "{1} is {0} years old".format(25, 'bob')
# "{:<10}{:<8}".format('name', 'age')
#42-shutil模块常用方法
# import shutil
# with open('/etc/passwd','rb') as sfobj:
#     with open('/tmp/mima.txt', 'wb') as dfobj:
#         shutil.copyfileobj(sfobj,dfobj)
# shutil.copyfile('/etc/passwd', '/tmp/mima.txt')
# shutil.copy('etc/passwd', '/tmp/mima.txt')     #cp
# shutil.copy2('/etc/passwd', '/tmp/mima.txt')     #cp -p
# shutil.move('/etc/passwd', '/tmp/mima.txt')      #mv
# shutil.copytree('/etc/passwd', '/tmp/mima.txt')     #cp -r
# shutil.rmtree('/etc/passwd', '/tmp/mima.txt')       #rm -rf
# shutil.copymode('/etc/passwd', '/tmp/mima.txt')     ## 将mima2.txt的元数据设置成与/etc/shadow一样
# shutil.copystat()# 元数据使用stat /etc/shadow查看
# shutil.chown('/tmp/mima2.txt', user= 'zhangsan',group='zhangsan')
#43-练习：生成文本文件
































